﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Chowpoo.Common;
using CourseSystem.Common;
using CourseSystem.Common.Helpers;
using CourseSystem.Core.BLL;
using CourseSystem.Stat;
using CourseSystem.Stat.ActionFilter;
using Webdiyer.WebControls.Mvc;

namespace CourseSystem.Web.Controllers
{
    public class StatController : BaseController
    {
        [StatFilter]
        [UrlStatFilter]
        public ActionResult Flash()
        {
            return Content("Succeed.");
        }

        [StatFilter]
        [UrlStatFilter]
        public ActionResult Index()
        {
            return View();
        }

        [StatFilter]
        [UrlStatFilter]
        public ActionResult LastIp()
        {
            return View();
        }

        public ActionResult StatDetailListUc(int? pid)
        {
            CommonRequest.ClearCache();
            var list = DailyStatBLL.GetList().OrderByDescending(o => o.Id);
            var model = list.ToPagedList(pid ?? 1, CommonHelper.PageSize);
            return PartialView(model);
        }

    }
}
